home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / Software / Freeware / NSIS 2.29 / nsis-2.29-setup.exe / Examples / nsDialogs / example.nsi next >
Encoding:
Text File  |  2007-07-14  |  1.3 KB  |  77 lines

  1. !include nsDialogs.nsh
  2. !include LogicLib.nsh
  3.  
  4. Name "nsDialogs Example"
  5. OutFile "nsDialogs Example.exe"
  6.  
  7. XPStyle on
  8.  
  9. Page license
  10. Page custom nsDialogsPage
  11.  
  12. Var BUTTON
  13. Var EDIT
  14. Var CHECKBOX
  15.  
  16. Function nsDialogsPage
  17.  
  18.     nsDialogs::Create /NOUNLOAD 1018
  19.     Pop $0
  20.  
  21.     GetFunctionAddress $0 OnBack
  22.     nsDialogs::OnBack /NOUNLOAD $0
  23.  
  24.     ${NSD_CreateButton} 0 0 100% 12u Test
  25.     Pop $BUTTON
  26.     GetFunctionAddress $0 OnClick
  27.     nsDialogs::OnClick /NOUNLOAD $BUTTON $0
  28.  
  29.     ${NSD_CreateText} 0 35 100% 12u hello
  30.     Pop $EDIT
  31.     GetFunctionAddress $0 OnChange
  32.     nsDialogs::OnChange /NOUNLOAD $EDIT $0
  33.  
  34.     ${NSD_CreateCheckbox} 0 -50 100% 8u Test
  35.     Pop $CHECKBOX
  36.     GetFunctionAddress $0 OnCheckbox
  37.     nsDialogs::OnClick /NOUNLOAD $CHECKBOX $0
  38.  
  39.     ${NSD_CreateLabel} 0 40u 75% 40u "* Type `hello there` above.$\n* Click the button.$\n* Check the checkbox.$\n* Hit the Back button."
  40.     Pop $0
  41.  
  42.     nsDialogs::Show
  43.  
  44. FunctionEnd
  45.  
  46. Function OnClick
  47.  
  48.     MessageBox MB_OK clicky
  49.  
  50. FunctionEnd
  51.  
  52. Function OnChange
  53.  
  54.     System::Call user32::GetWindowText(i$EDIT,t.r0,i${NSIS_MAX_STRLEN})
  55.  
  56.     ${If} $0 == "hello there"
  57.         MessageBox MB_OK "right back at ya"
  58.     ${EndIf}
  59.  
  60. FunctionEnd
  61.  
  62. Function OnBack
  63.  
  64.     MessageBox MB_YESNO "are you sure?" IDYES +2
  65.     Abort
  66.  
  67. FunctionEnd
  68.  
  69. Function OnCheckbox
  70.  
  71.     MessageBox MB_OK "checkbox clicked"
  72.  
  73. FunctionEnd
  74.  
  75. Section
  76. SectionEnd
  77.